 // 基于准备好的dom，初始化echarts实例
 var myChart1 = echarts.init(document.getElementById("left-top"),'dark'); 

    var jsonData = {
        name: [],
        count: []
    }
    $.ajax({
        url: '/data_province_confirmed_max',
        method: 'GET',
        dataType: 'json',
        success: function(data){
            jsonData.name = data.name
            jsonData.count = data.count
            var option = {
               title: {
                   text: '全球各国电影数量饼状图',
                   textStyle: {
                       color: 'black',
                       fontSize: 18,
                       color: 'lightgray'
                   },
                   subtextStyle: {
                       color: 'black',
                       fontSize: 16,
                       color: 'lightgray'
                   },
                   left: 'center'
               },
               tooltip: {},
               toolbox: {
                   show: 'true',
                   feature: {
                       mark: {},
                       dataView: { readOnly: true },
                       magicType: { type: ['line', 'bar', 'stack'] },
                       restore: {},
                       saveAsImage: {}
                   },
               },    
               legend: {
                   data:['电影数量'],
                   left: 'left',
                   textStyle:{
                       color: 'lightgray'
                   }
               },
               grid: {
                   top: '20%',
                   left: 'center',
                   width: '95%',
                   height: '70%',
                   containLabel: true
               },
               xAxis: {
                   axisLabel: {
                       color: 'lightgray',
                       fontSize: 18,
                       interval: 0,
                   },
                   data: jsonData.name
               },
               yAxis: {
                   name: '数量',
                   nameTextStyle: {
                       color: 'lightgray',
                       fontSize: 18
                   },
                   axisLabel: {
                       color: 'lightgray',
                       fontSize: 18,
                       interval: 0,
                   },
               },
               series: [{
                   name: '数量',
                   type: 'bar',
                   data: jsonData.count
               }],
               dataZoom: [
                   {
                       start: 70,
                       end: 100
                   },
                   {
                       yAxisIndex: 0,
                   },
               ]
           };
          
           // 使用刚指定的配置项和数据显示图表。
           myChart1.setOption(option);
        },
        error: function(msg){console.log(msg)}
    });

